<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="layout">
<head>
<title>秒杀团购商品管理</title>
 <script th:inline="javascript">
/*<![CDATA[*/

    function add(event,element){
    	event.preventDefault();
    	var re = /^[0-9]+.?[0-9]*$/; 
    		
   		var _id = $(element).attr("href").split("_")[0];
   		var _price = $("#promotion"+_id).val();
   		var _spid = $(element).attr("href").split("_")[1];
  

   		if(_price==''){
   			alert("促销价格不能为空");return;
   		}else if(!re.test(_price)){
   			alert("请输入正确的促销价格");return;
   		}
   		BOSS.remoteCall('promotion/seckillgroupbuygoods/ajaxsave',$('#div_seckillgroupbuygoods_grid'),{id:_id,price:_price,spid:_spid,spadd:'spadd'});
    }
	
/*]]>*/
</script>
</head>
<body>
<div layout:fragment="content">
	<div class="row">
		<div class="col-md-12">
			<div class="btn-group pull-right">
				<a href="index.html" th:href="@{'/promotion/seckillgroupbuygoods/index/'+${secKillGroupBuyId}}" id="sample_editable_1_new" class="btn green">返回<i class="fa fa-arrow-circle-o-left"></i></a>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<div class="form">
					<h4 class="form-section">秒杀团购商品信息</h4>
					
					<div class="form-body">
					<div class="col-md-15 col-sm-13">
						<form class="form-inline" style="float:left;margin-right:50px;" th:action="@{'/promotion/seckillgroupbuygoods/list/'+${secKillGroupBuyId}}"  th:object="${goodsSearch}"  method="post">
							<div class="form-group">
					            <select id="goodsBrandsId" name="goodsBrandsId" style="width:110px;" th:remove="none" class="form-control">
					            	<option value="">所有品牌</option>
					                <option th:each="eachValue : ${brands}" th:field="*{goodsBrandsId}" th:value="${eachValue.id}" th:text="${eachValue.name}"></option>
					            </select>	
					            <input type="hidden" id="hidden_goodsBrandsId" th:value="${goodsBrandsId}" />												
						</div>
							
							<div class="form-group">
					            <select id="goodsCategoryId" name="goodsCategoryId" style="width:110px;" th:remove="none" class="form-control">
					            	<option value="">所有分类</option>
					                <option th:each="eachValue : ${categorys}" th:field="*{goodsCategoryId}" th:value="${eachValue.id}" th:text="${eachValue.name}"></option>
					            </select>
					            <input type="hidden" id="hidden_goodsCategoryId" th:value="${goodsCategoryId}" />														
							</div>
		
							
							<div class="form-group">
							<label class="sr-only" for="keyword">keyword</label>
								<input type="text" name="keyword" style="width:80px;" th:field="*{keyword}" placeholder="关键字"  id="keyword" class="form-control" />
							</div>
	
							
							
							<button type="submit" id="bt_search" name="bt_search" class="btn green">
								<i class="fa  fa-search"></i>
							</button>
						</form>
						
						<form class="form-inline" th:action="@{'/promotion/seckillgroupbuygoods/uploadgoods/'+${secKillGroupBuyId}}"  th:object="${goodsFile}" enctype="multipart/form-data"
						  method="POST">
							<div class="form-group">
							<label class="sr-only" for="goodsFile">批量上传商品</label>
								<input type="File" name="goodsFile" th:field="*{goodsFile}" placeholder="上传文件"  id="goodsFile"  />
							</div>
							<button type="submit" id="bt_search" name="bt_search" class="btn green">
								<i class="fa  fa-plus">上传</i>
							</button>
						</form>
					</div>
					
					
					</div>
					<table layout:fragment="goods_table" class="table table-striped table-bordered  table-advance table-hover" id="goods_grid" onload="myfunction()">
						<thead>
							<tr>
								<th>商品名称</th>
								<th>价格</th>
								<th>限购数量</th>
								<th>促销价格</th>
							</tr>
						</thead>	
					</table>
					
			</div>
		</div>
	</div>
</div>	
</body>
</html>
